package au.org.emii.portal;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;


public class WMSSupport_1_1_1 extends WMSSupportNonXmlbeans  {

	public WMSSupport_1_1_1() {
		serviceTitleXpath = "/WMT_MS_Capabilities/Service/Title/text()";
		
		baseUriXpath = 
			"/WMT_MS_Capabilities/Capability/Request/GetMap/DCPType/HTTP/Get/OnlineResource/@href";
	
		/**
		 * Set the default image format for this server - we will use the first
		 * format element they provide which is *1* and not *0* in the list of
		 * formats
		 */
		imageFormatXpath = 
			"/WMT_MS_Capabilities/Capability/Request/GetMap/Format[1]/text()";
		rootLayerXpath = 
			"/WMT_MS_Capabilities/Capability/Layer";
		serviceAbstractXpath = "/WMT/MS_Capabilities/Service/Abstract/text()";
		
		
		layerLabelXpath = "child::Title/text()";
		layerLayersXpath = "child::Name/text()";
		childLayersXpath = "child::Layer";
		queryableXpath = "@queryable";
		layerDescriptionXpath = "child::Abstract/text()";
		
		styleXpath = "Style";
		styleNameXpath = "Name/text()";
		styleTitleXpath = "Title/text()";
		styleDescriptionXpath = "Abstract/text()";
		styleImageFormat = "LegendURL/format[1]/text()";
		styleImageUri = "LegendURL/OnlineResource/@href";
	}

	@Override
	protected void layerSettings(MapLayer mapLayer, Node layer) {
		mapLayer.setType(LayerUtilities.WMS_1_1_1);		
	}

	@Override
	protected void styleSettings(WMSStyle style, NodeList serverStyles) {}


}
